package handler.accountFormHandlers;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import customGUI.selectors.ComboBoxAccountSelector;


import db.Account;

import form.AccountForm.AccountForm;

public class ComboBoxAccountSelectorListener implements ActionListener {

	private AccountForm accountForm;
	private ComboBoxAccountSelector accountSelector;
	
	public ComboBoxAccountSelectorListener(AccountForm accountForm, ComboBoxAccountSelector accountSelector){
		this.accountForm = accountForm;
		this.accountSelector = accountSelector;
	}
	
	@Override
	public void actionPerformed(ActionEvent arg0) {
		accountForm.clear();
		if(accountSelector.getSelectedUsername()!= null)
			 accountForm.populate(accountSelector.getSelectedUsername());
	}

}
